package main

import (
	"fmt"
	"net"
	"operator/pkg/types/unix"
	"operator/pkg/util"
)

func main() {
	dial, err := net.Dial("tcp", "192.168.189.136:25500")
	if err != nil {
		fmt.Println(err)
		return
	}

	req := unix.UnixRequest{
		Name:      "busybox-78644c6f64-4b24k",
		NameSpace: "default",
		Type:      "pod",
	}
	str := util.JsonEncode(req)
	dial.Write([]byte(str))
	fmt.Println(1)

	buf := make([]byte, 1024*30)
	read, err := dial.Read(buf)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(buf[:read]))
}
